package test.aat.dxfy.demo01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import com.aat.dxfy.utils.Atools;

public class XlsRead01 {

	public static void main(String[] args) {
		try {
			XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream("F:\\我的桌面\\paris\\2大众点评营销\\6大众点评4Lily.xlsx"));
			XSSFCell cell = null;
			for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) {
				XSSFSheet st = wb.getSheetAt(sheetIndex);
				for (int rowIndex = 0; rowIndex <= st.getLastRowNum(); rowIndex++) {
					XSSFRow row = st.getRow(rowIndex);
					cell = row.getCell(0);
					cell.setCellType(XSSFCell.CELL_TYPE_STRING);
					String s = cell.getStringCellValue();
					s=s.replaceAll("🐨", "").replaceAll("🌹🌹🌹🌹🌹🌹", "").replaceAll("👍", "").replaceAll("👍","");
					s+="\n\n";
					//System.out.println("insert into paris_text(text) values('"+s+"');");
					Atools.writeStrAppend("F:\\我的桌面\\paris\\2大众点评营销\\点评语言.xml", s);
				}
			}
			wb.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
